package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.domain.db.SoulReport;
import com.tanhua.dubbo.api.db.SoulReportApi;
import com.tanhua.dubbo.mapper.SoulReportMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;


@DubboService
public class SoulReportApiImpl implements SoulReportApi {

    @Autowired
    private SoulReportMapper soulReportMapper;

    @Override
    public SoulReport queryReport(String questionnaireId, String score) {
        SoulReport soulReport = soulReportMapper.queryReport(questionnaireId,score);
        return soulReport;
    }

    @Override
    public SoulReport queryResult(Integer reportId) {
        QueryWrapper<SoulReport> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(SoulReport::getId,reportId);
        SoulReport soulReport = soulReportMapper.selectOne(wrapper);
        return soulReport;
    }
}
